/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 */
package com.jeesite.modules.bigstorage.entity;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.NotBlank;
import org.hibernate.validator.constraints.Length;
import java.util.List;
import com.jeesite.common.collect.ListUtils;

import com.jeesite.common.entity.DataEntity;
import com.jeesite.common.mybatis.annotation.Column;
import com.jeesite.common.mybatis.annotation.Table;
import com.jeesite.common.mybatis.mapper.query.QueryType;

/**
 * 商品表Entity
 * @author zhuqingya
 * @version 2019-12-13
 */
@Table(name="biz_goods", alias="a", columns={
		@Column(name="id", attrName="id", label="唯一标识", isPK=true),
		@Column(name="sort", attrName="sort", label="顺序"),
		@Column(name="cate_id", attrName="cateId", label="分类id"),
		@Column(name="brand_id", attrName="brandId", label="品牌id"),
		@Column(name="thumbnail", attrName="thumbnail", label="缩略图"),
		@Column(name="code", attrName="code", label="编码"),
		@Column(name="name", attrName="name", label="名称", queryType=QueryType.LIKE),
		@Column(name="material", attrName="material", label="材质"),
		@Column(name="place", attrName="place", label="产地"),
		@Column(name="content", attrName="content", label="详情"),
		@Column(name="deleted", attrName="deleted", label="删除"),
		@Column(name="create_by", attrName="createBy", label="创建者", isUpdate=false, isQuery=false),
		@Column(name="create_date", attrName="createDate", label="创建时间", isUpdate=false, isQuery=false),
		@Column(name="update_by", attrName="updateBy", label="更新者", isQuery=false),
		@Column(name="update_date", attrName="updateDate", label="更新时间", isQuery=false),
		@Column(name="remarks", attrName="remarks", label="备注信息", queryType=QueryType.LIKE),
	}, orderBy="a.update_date DESC"
)
public class Goods extends DataEntity<Goods> {
	
	private static final long serialVersionUID = 1L;
	private Long sort;		// 顺序
	private String cateId;		// 分类id
	private String brandId;		// 品牌id
	private String thumbnail;		// 缩略图
	private String code;		// 编码
	private String name;		// 名称
	private String material;		// 材质
	private String place;		// 产地
	private String content;		// 详情
	private String deleted;		// 删除
	private List<GoodsSpec> goodsSpecList = ListUtils.newArrayList();		// 子表列表
	
	public Goods() {
		this(null);
	}

	public Goods(String id){
		super(id);
	}
	
	@NotNull(message="顺序不能为空")
	public Long getSort() {
		return sort;
	}

	public void setSort(Long sort) {
		this.sort = sort;
	}
	
	@NotBlank(message="分类id不能为空")
	@Length(min=0, max=64, message="分类id长度不能超过 64 个字符")
	public String getCateId() {
		return cateId;
	}

	public void setCateId(String cateId) {
		this.cateId = cateId;
	}
	
	@NotBlank(message="品牌id不能为空")
	@Length(min=0, max=64, message="品牌id长度不能超过 64 个字符")
	public String getBrandId() {
		return brandId;
	}

	public void setBrandId(String brandId) {
		this.brandId = brandId;
	}
	
	@NotBlank(message="缩略图不能为空")
	@Length(min=0, max=2048, message="缩略图长度不能超过 2048 个字符")
	public String getThumbnail() {
		return thumbnail;
	}

	public void setThumbnail(String thumbnail) {
		this.thumbnail = thumbnail;
	}
	
	@NotBlank(message="编码不能为空")
	@Length(min=0, max=255, message="编码长度不能超过 255 个字符")
	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}
	
	@NotBlank(message="名称不能为空")
	@Length(min=0, max=255, message="名称长度不能超过 255 个字符")
	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}
	
	@NotBlank(message="材质不能为空")
	@Length(min=0, max=255, message="材质长度不能超过 255 个字符")
	public String getMaterial() {
		return material;
	}

	public void setMaterial(String material) {
		this.material = material;
	}
	
	@Length(min=0, max=255, message="产地长度不能超过 255 个字符")
	public String getPlace() {
		return place;
	}

	public void setPlace(String place) {
		this.place = place;
	}
	
	@Length(min=0, max=2048, message="详情长度不能超过 2048 个字符")
	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}
	
	public String getDeleted() {
		return deleted;
	}

	public void setDeleted(String deleted) {
		this.deleted = deleted;
	}
	
	public List<GoodsSpec> getGoodsSpecList() {
		return goodsSpecList;
	}

	public void setGoodsSpecList(List<GoodsSpec> goodsSpecList) {
		this.goodsSpecList = goodsSpecList;
	}
	
}